Skip to content

feat(database): add oracle provider integration via python-oracledb#225

Open
david-mamani wants to merge 10 commits intoNevaMind-AI:mainfrom
david-mamani:feat/oracle-integration
Open

feat(database): add oracle provider integration via python-oracledb#225
david-mamani wants to merge 10 commits intoNevaMind-AI:mainfrom
david-mamani:feat/oracle-integration

Conversation

@david-mamani
Copy link
Contributor

@david-mamani david-mamani commented Jan 12, 2026

Description
This Pull Request implements support for Oracle Database as a storage provider for MemU, addressing the requirements for Track D (External Tool / Database Integration) and Issue #168.

The implementation utilizes the python-oracledb driver in Thin mode to ensure lightweight connectivity without requiring Oracle Instant Client binaries. The architecture strictly follows the design patterns established by the existing PostgreSQL provider to ensure code consistency and maintainability, leveraging SQLAlchemy and SQLModel for typed database interactions.

Technical Implementation

  • Core Logic: Introduced the memu.database.oracle package, including OracleStore and specific repositories (OracleResourceRepo, OracleMemoryItemRepo).
  • Factory Registration: Updated src/memu/database/factory.py to recognize the oracle provider configuration.
  • Testing Strategy: Added a comprehensive mock-based unit test suite (tests/test_oracle_mock.py). This validates the connection flow, session management, and CRUD operations within the CI/CD environment without requiring a live Oracle instance, ensuring verifiable logic stability.
  • Documentation: Included docs/oracle_integration.md to provide isolated installation and configuration instructions without modifying the main README to avoid conflicts.

How to Test
The integration includes a validation script that mocks the database engine, allowing verification of the driver logic and repository flow:

  1. Install the required dependency:
    uv add oracledb

  2. Run the verification suite:
    uv run pytest tests/test_oracle_mock.py

Resolves #168

@Jununn
Copy link
Contributor

Jununn commented Jan 13, 2026

Hi, the build for this PR is not passing yet. Please make the necessary updates, and we’ll review again after that. Thanks! @david-mamani

pyproject.toml Outdated
"sqlmodel>=0.0.27",
"alembic>=1.14.0",
"pendulum>=3.1.0",
"oracledb>=3.4.1",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend we do not add oracledb as a default (hard) dependency of the base package. It's fine to keep this as an optional dependency (extra) so only Oracle users pull it in, e.g. pip install memu-py[oracle].

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've refactored pyproject.toml to make oracledb an optional dependency and implemented lazy loading in the source code. Tests are passing locally without the driver installed.

@ankaisen ankaisen force-pushed the feat/oracle-integration branch from 10a381d to 96bfd15 Compare January 14, 2026 15:00
@david-mamani david-mamani force-pushed the feat/oracle-integration branch from 96bfd15 to 7e6f54c Compare January 14, 2026 16:33
@david-mamani david-mamani requested a review from ankaisen January 14, 2026 16:38
@david-mamani david-mamani force-pushed the feat/oracle-integration branch from f47ff15 to f4a80cc Compare January 17, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[2026NewYearChallenge] Database Integration——Oracle

3 participants